﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Script.Serialization;
using System.Web.UI;

namespace SmartSpace.Web
{
    public class SsPage : Page
    {
        public string HostUrl { get; set; }
        public string AppUrl { get; set; }
        public SmartSpace.Core.User SsUser { get; internal set; }

        public static void Return(Page page, object result)
        {
            JavaScriptSerializer jss = new JavaScriptSerializer();
            string json = jss.Serialize(result);
            page.Response.Write(@"<script> function ss_return(){window.parent.window._ss.close(" + json + @");}ss_return();</script>");
        }
    }
}
